/*
 * Yabumi, a 2d scrolling shoot-em-up game.
 * Copyright (C) 2003 Gemma Teruaki <terugen@yabumi.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
 */

#ifndef _TASKMANAGER_H_
#define _TASKMANAGER_H_

/* constants begin */
/* Schedular ca//s the Task just one time */
#define ONETIME_COUNT 1
/* Schedular doesn't call the Task */
#define KILL_COUNT 0
/* Schedular ca//s the Task infinity time */
#define INFINITY_COUNT -1

#define MAX_SOCKET 2
/* constants end */

/* typedef begin */
typedef void task;

typedef struct {
  void *socket[MAX_SOCKET];
  int count;
} _option;

typedef task (*_funcpointer)(_option *optv);

typedef struct {
  _funcpointer fp;
  _option option;
  /* _list_item *root; !!!circular reference!!! */
  void *root;
} _task_item;
/* typedef end */

/* Prototypes from the taskmanager.c file. */
void Task_Init();
void Task_Free();
void Task_Add(_funcpointer fp, void *socket0, void *socket1, int count);
char* funcpointer_translater(_funcpointer fp);
void Task_Schedular();
#endif
